<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>KLIPSE: a simple and elegant online cljs compiler and evaluator</title>
        <link rel='shortcut icon' type='image/x-icon' href='img/klipse.png' />
        <link rel="stylesheet" type="text/css" href="css/codemirror.css">
    </head>
    <body>
      <style>
	.klipse-snippet {
	width: 50%;
	float: left;
	}
	.klipse-result {
	width: 50%;
	float:left;
	}
	.klipse-separator {
	clear: both;
	}
      </style>

<pre><code class="js" data-async-code="true">
    function a () { return "a";}
    window.a = a;
    setTimeout(function() {
    console.log("1st snippet", 1/0, [1, 2, {a: 2}]);
    }, 1000);
</code></pre>
<pre><code class="js" data-async-code="true">
    setTimeout(function() {
    console.log("1st snippet", 1/0, [1, 2, {a: a()}]);
    }, 1000);
</code></pre>

<pre><code class="js" data-async-code="true">
    setTimeout(function() {
    console.log("2nd snippet");
    console.log("2nd snippet - bb");
    }, 500);
</code></pre>


<pre><code class="js">
2 + 3
</code></pre>

<pre><code class="js">
console.log("inside");
</code></pre>
<pre><code class="js">
a = new Set();
a.add(1);
a.add(2);
x = {a: 1,
     aa: a,
     date: new Date(),
     rrr: /^aa[a]+$/,
     c: [1/0, NaN, Promise.resolve(1)],
     arr: new Int32Array(3),
     d: Symbol("dd")}
x.selfRef = x;
x
</code></pre>
<br/>
<pre><code class="js" data-gist-id="viebel/5cc67a97903f04036b569c0eb0436e5f">
</code></pre>

<pre><code class="js">
    permutations([1, 2, 3])
</code></pre>

    <div class="eval-js">
      console.log("CCC")
      2 + 3
    </div>
    <br/>

    <div class="eval-js">
      klipse_container.innerHTML="hello";
      2+1
    </div>
    <br/>

    <div class="eval-js">
      klipse_container.innerHTML="foo";
      [1,2,3]
    </div>
    <br/>

    <div class="eval-js">
      throw 'This is an exception.'
    </div>

    <h2> Function defs should be shared between snippets </h2>
    <pre><code class="eval-js">
	function foo(){
	if (5 > 2){
	return 5;
	} else {
        return 9;
	}
	}
    </code></pre>
    <pre><code class="eval-js">
	foo()
    </code></pre>
    <div class="eval-js">
      console.log("aa")
      console.log("aa", 1, 2, 34, 4)
      console.log("bb")
      2 + 3
    </div>
    <br/>

      <script>
        window.klipse_settings = {
        selector_eval_js_stopify: '.js,.eval-js',
        };
        </script>
      <script src="/cljs-out/dev-main.js"></script>
    </body>
</html>
